package com.tekj.cxqcb.view.Module.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tekj.cxqcb.R;
import com.tekj.cxqcb.view.Module.bean.InformationAnnexBean;

import java.util.List;

public class InformationAnnexAdapter extends BaseQuickAdapter<InformationAnnexBean, BaseViewHolder> {

    public InformationAnnexAdapter(@Nullable List<InformationAnnexBean> data) {
        super(R.layout.item_information_annex, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, InformationAnnexBean item) {

        helper.setText(R.id.tv_title,item.getTitle());

        RecyclerView rvMain = helper.getView(R.id.item_rv_main);
        rvMain.setLayoutManager(new GridLayoutManager(mContext, 3));
        rvMain.setHasFixedSize(true);
        rvMain.setAdapter(new InformationAnnex2Adapter(item.getList()));

    }
}
